{extend name="public:layout" /}
{block name="title"}店铺管理{/block}
{block name="head"}
<style>
    .area_name select{width:33%;float:left;}
</style>
{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> <a href="{:url('index')}"> 店铺列表</a></li>
                <li class="active">添加店铺</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺创始人</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" placeholder="请输入店铺创始人用户名/手机号/邮箱任意一种"
                               name="account" datatype="*" />
                        <p class="help-block text-danger">前提：该账号必须已在平台注册过会员并且没有设立过店铺</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺名称"
                               name="site_name" datatype="*" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">公司名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入公司名称"
                               name="company_name" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">营业执照</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入营业执照号"
                               name="site_no" datatype="*" nullmsg="请输入营业执照号" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺分类</label>
                    <div class="col-sm-4">
                        <select name="site_class_id" class="form-control">
                            <option value="0">请选择</option>
                            {volist name="siteClass" id="vo"}
                            <option value="{$vo.site_class_id}">{$vo.site_class_name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">推荐店铺</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="site_recommend" value="1" /> 是
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="site_recommend" value="0" checked /> 否
                        </label>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺状态</label>
                    <div class="col-sm-4">
                        <select name="site_status" class="form-control">
                            <option value="0">关闭</option>
                            <option value="1" selected>开启</option>
                            <option value="2">审核中</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺等级</label>
                    <div class="col-sm-4">
                        <select name="grade_id" class="form-control">
                            <option value="5">★★★★★</option>
                            <option value="4">★★★★</option>
                            <option value="3" selected>★★★</option>
                            <option value="2">★★</option>
                            <option value="1">★</option>
                        </select>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺电话</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺电话"
                               name="site_tel" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">营业执照</label>
                    <div class="col-sm-4">
                        <p class="form-control-static">
                            {:widget('common/Form/singleImg',['site_image','',$uid])}
                        </p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺坐标</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" class="form-control" name="coordinate" value="{$info.lat},{$info.lng}">
                            <span class="input-group-btn"> <button onclick="getpos()" type="button" class="btn btn-primary">定位
                                        </button> </span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺地址</label>
                    <div class="col-sm-6">
                        {php}
                        $areaValue = $info['prov_id'].','.$info['city_id'].','.$info['dist_id'];
                        {/php}
                        {:widget('common/Form/areaName',['prov_id,city_id,dist_id',$areaValue])}
                    </div>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺地址"
                               name="address" value="{$info.address}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺排序</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺排序"
                               name="site_sort" value="{$info.site_sort}" datatype="n" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" type="button" id="btnSub">保存内容</button>
                        <a href="{:url('index')}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub');
    });
    function getpos() {
        In('layer',function () {
            layer.open({
                type: 2,
                title: '请点击后复制坐标',
                shadeClose:true,
                area: ['90vw', '90vh'],
                anim: 2,
                content: ["{:url('/plus/Bmap/getPos')}"]
            });
        })
    }
</script>
{/block}